<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>添加员工</title>
    <!-- 引入Bootstrap样式 -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.2/dist/css/bootstrap.min.css" rel="stylesheet">
</head>

<body>
<div class="container mt-5">
    <h2 class="text-center">更新员工</h2>

    <!-- 员工添加表单 -->
    <form th:action="@{/updateEmp}" method="POST">
        <div class="form-group" >
            <label for="id">员工id：</label>
            <input th:value="${emp.getId()}" type="text" class="form-control" id="id" name="id" required readonly>
        </div>
        <div class="form-group" >
            <label for="password">员工密码：</label>
            <input th:value="${emp.getPassword()}" type="hidden" class="form-control" id="password" name="password" >
        </div>
        <div class="form-group">
            <label for="name">员工姓名：</label>
            <input th:value="${emp.getName()}" type="text" class="form-control" id="name" name="name" required>
        </div>
        <div class="form-group">
            <label for="email">员工邮箱：</label>
            <input th:value="${emp.getEmail()}" type="email" class="form-control" id="email" name="email" required>
        </div>
        <div class="form-group">
            <label for="gender">性别：</label>
            <select class="form-control" id="gender" name="gender">
                <option th:selected="${emp.getGender()==1}" value="1">男</option>
                <option th:selected="${emp.getGender()==0}" value="0">女</option>
            </select>
        </div>

        <div class="form-group">
            <label for="department">部门：</label>
            <input id="department" name="department" th:value="${emp.getDepartment()} ">
        </div>
        <div class="form-group">
            <label for="birth">员工生日：</label>
            <input th:value="${emp.getBirth()}" type="text" class="form-control" id="birth" name="birth" required>
        </div>


        <button  class="btn btn-secondary">修改</button>
        <a th:href="@{/emps}" class="btn btn-secondary">返回员工列表</a>
    </form>
</div>

<!-- 引入Bootstrap和jQuery脚本 -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.2/dist/js/bootstrap.bundle.min.js"></script>
</body>

</html>
